pub mod core;
pub mod file_stream;
pub mod memory_stream;

#[cfg(test)]
mod tests {
    use crate::reader::binary::core::{BinaryReader, BinaryWriter};
    use crate::reader::binary::file_stream::FileStream;

    #[test]
    fn test() {
        let mut stream = FileStream::new_write_stream("tmp/test.bin", true, true).unwrap();
        let mut bw = BinaryWriter::new(&mut stream);

        let write_result = bw.write_isize(713);
        println!("{:?}", write_result);
        let write_result = bw.write_isize(318);
        println!("{:?}", write_result);

        let mut fs1 = FileStream::new_read_stream("tmp/test.bin").unwrap();
        let mut br = BinaryReader::new(&mut fs1);
        loop {
            match br.read_isize() {
                Ok(o) => { println!("{}", o); }
                Err(_) => { break; }
            }
        }
    }
}